<?php
namespace Emos\ListField;

use Emos\Common;

class Number extends AbstractListField {       
    protected $sprintfFormat = null;
    
    public function setSprintf($sprintfFormat) {
        $this->sprintfFormat = $sprintfFormat;
        return $this;
    }

    function getHtml() {    
        $val = $this->value;
        if($this->sprintfFormat) {
            $val = sprintf($this->sprintfFormat, $val);
        }
        return Common::plain($val);               
    }  

    public function getContainerStyles() {
        return array('text-align'=>'right');
    }    
}